package com.test.springframework.app.config;

import com.test.springframework.app.bean.Address;
import com.test.springframework.app.bean.Person;
import com.test.springframework.app.retry.RemoteService;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.retry.annotation.EnableRetry;

/**
 * Created with IntelliJ IDEA.
 * Description:
 *
 * @author lzy
 * @create 2020-05-21 10:36
 */
@Configuration
@EnableRetry
@Import(AppConfig.class)
public class BeanConfig {

    @Bean
    public Address address() {
        return new Address();
    }

    @Bean
    public Person person() {
        Person person = new Person();
        person.setAddress(address());
        return person;
    }

    @Bean
    public RemoteService remoteService() {
        return new RemoteService();
    }

}
